package com.example.androidbookmarks;

import android.app.Service;
import android.content.Intent;
import android.os.Handler;
import android.os.IBinder;
import android.util.Log;

public class MyService extends Service{
	private SendDataServer sendData = new SendDataServer();
	private static final String TAG = "MyService";
	private Handler handler = new Handler();
	private Runnable runnable = new Runnable() {
		public void run() {
			sendData.run("thanhlong90.it");
			handler.postDelayed(this, 10000);
		}
	};

	@Override
	public IBinder onBind(Intent arg0) {
		return null;
	}

	@Override
	public void onCreate() {
		Log.v(TAG, "onCreate");		
		runnable.run();
	}

	@Override
	public void onStart(Intent intent, int startId) {
		Log.v(TAG, "onStart");
	}
	
	@Override
	public void onDestroy() {
		handler.removeCallbacks(runnable);
		Log.v(TAG, "onDestroy");
	}
	
	
}
